#ifndef FITNESSEVALUATOR_H
#define FITNESSEVALUATOR_H

#include "Candidate.h"

class FitnessEvaluator
{
public:
    FitnessEvaluator(float targetValue,int generationLimit);
    bool evaluateFitness(std::vector<Candidate*> population);
    virtual float getFitness(Candidate*);

    Candidate* returnWinner(std::vector<Candidate*> population);
    Candidate* migrateCandidate(std::vector<Candidate*> population);
    bool isNatural();
    float targetValue;
    void setTargetValue(float targetValue);
    int generationLimit;
    float getFinalValue();
protected:
    virtual Candidate* finalize(Candidate*);
    int generation;
    float finalValue;
    float fitness;
};

#endif // FITNESSEVALUATOR_H
